TARGET := cms_core

SRC = $(wildcard *.c)
COBJS = $(patsubst %.c,%.o, $(SRC))

CFLAGS += 

LDFLAGS += -lcmsmdm -lpthread

all: $(TARGET)
	cp $(TARGET) $(CMS_LIB_DIR)
	@echo "###################################"
	@echo "#        $(TARGET) "
	@echo "#        Build up successfully"
	@echo "###################################"		

$(TARGET): $(COBJS)
	$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)

$(COBJS):%.o:%.c
	@#printf "  CC      $(*).c\n"
	$(CC) $(CFLAGS) -c $< -o $@	

clean:
	@echo "###################################"
	@echo "#        clean $(TARGET) "
	@echo "###################################"		
	rm -f *.o *.d $(TARGET) $(COBJS)
